 <template>
  <div>
    <main>
      <div class="m-t">
        <p><img src="@/assets/hours.png" alt="" /><span>附近商家</span></p>
      </div>
      <dl v-for="(item, index) in xq" :key="index" @click="blak(item)">
        <dt><img :src="fr(item.image_path)" alt="" /></dt>
        <dd>
          <p>
            <span
              ><i>品牌</i><i>{{ item.name }}</i></span
            ><span>保准票</span>
          </p>
          <p>
            <span>
              <div class="grayxx">
                <div
                  class="yellowxx"
                  :style="{ width: (item.rating / 5) * 100 + '%' }"
                ></div>
              </div>
              <i
                >{{ item.rating
                }}<span>月售{{ item.recent_order_num }}</span></i
              ></span
            ><span><i>蜂鸟专送</i><i>准时达</i></span>
          </p>
          <p>
            <span
              >￥{{ item.float_minimum_order_amount }}起送 / 配送费约{{
                item.float_delivery_fee
              }}元</span
            >
            <span>10公里/<i>40分钟</i></span>
          </p>
        </dd>
      </dl>
    </main>
  </div>
</template>
 <script>
export default {
  props: ["xq"],
  data() {
    return {};
  },
  methods: {
    fr(str) {
      return "http://elm.cangdu.org/img/" + str.split("\\").join("/");
    },
    //跳转到订单详情页
    blak(item) {
      this.$router.push({ path: "/Deliverydetails", query: { id: item.id } });
    },
  },
  mounted() {},
  computed: {},
};
</script>
 <style lang='css' scoped>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
main {
  flex: 1;
  background: #f5f5f5;
  padding-top: 1rem;
  box-sizing: border-box;
}
.m-t {
  width: 100%;
  height: 4rem;
  background: #ffff;
  padding-top: 0.8rem;
  padding-left: 0.5rem;
}
.m-t p {
  width: 6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.m-t p img {
  width: 2rem;
  height: 2rem;
}
.m-t p span {
  font-size: 14px;
  color: #999999;
}

dl {
  width: 100%;
  height: 8rem;
  border-bottom: 1px solid #f1f1f1;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0rem 1rem;
}
dl dt {
  width: 5rem;
  height: 5rem;
}
dl dt img {
  width: 100%;
  height: 100%;
}
dl dd {
  width: 15rem;
  height: 5rem;
  display: flex;
  flex-direction: column;
  position: relative;
}
dl dd p {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
dl dd p:nth-of-type(1) {
  width: 100%;
  height: 1.5rem;
}
dl dd p:nth-of-type(1) span:nth-of-type(1) {
  width: 7rem;
  height: 1rem;
  display: flex;
  /* justify-content: space-between; */
  /* justify-content: center; */
  align-items: center;
  font-weight: 700;
  font-size: 13px;
}
dl dd p:nth-of-type(1) span:nth-of-type(2) {
  color: #999;
  font-size: 13px;
}
dl dd p:nth-of-type(1) span:nth-of-type(1) i {
  font-weight: 400;
  width: 2rem;
  height: 100%;
  font-size: 13px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #ffd930;
  font-style: normal;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-right: 5px;
}
dl dd p:nth-of-type(1) span:nth-of-type(1) i:nth-of-type(2) {
  width: 5rem;
  font-size: 13px;
  background: none;
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
dl dd p:nth-of-type(2) {
  width: 100%;
  height: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
dl dd p:nth-of-type(2) span:nth-of-type(1) {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

dl dd p:nth-of-type(2) span:nth-of-type(1) i:nth-of-type(1) {
  font-style: normal;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #ff6000;
}
dl dd p:nth-of-type(2) span:nth-of-type(1) i:nth-of-type(1) span {
  color: #666;
  font-size: 13px;
}
dl dd p:nth-of-type(2) span:nth-of-type(2) {
  width: 5.5rem;
  height: 100%;
  display: flex;
  font-style: normal;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  white-space: normal;
}
dl dd p:nth-of-type(2) span:nth-of-type(2) i {
  font-size: 12px;
  font-style: normal;
  background: #3190e8;
  color: #ffff;
}
dl dd p:nth-of-type(2) span:nth-of-type(2) i:nth-of-type(2) {
  background: none;
  color: #3190e8;
  border: 1px solid #3190e8;
}

dl dd p:nth-of-type(2) span:nth-of-type(1) i:nth-of-type(1) img {
  width: 0.8rem;
  height: 0.8rem;
}
dl dd p:nth-of-type(3) {
  width: 100%;
  height: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
dl dd p:nth-of-type(3) span:nth-of-type(1) {
  color: #666;
  font-size: 13px;
}
dl dd p:nth-of-type(3) span:nth-of-type(2) {
  color: #666;
  font-size: 13px;
}
dl dd p:nth-of-type(3) span:nth-of-type(2) i {
  color: #3190e8;
  font-style: normal;
}
dl dd p:nth-of-type(2) span:nth-of-type(1) .grayxx {
  width: 3rem;
  height: 0.6rem;
  position: relative;
  background-image: url("../assets/star-full.png");
  background-size: 0.6rem;
}
.yellowxx {
  position: absolute;
  width: 3rem;
  height: 0.6rem;
  top: 0rem;
  left: 0rem;
  background-image: url("../assets/star-full1.png");
  background-size: 0.6rem;
}
</style>